package org.libraq.hrm.exception;

import org.libraq.hrm.util.AjaxResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionHandlers {


    @ExceptionHandler(value = GlobalException.class)
    public AjaxResult GlobalExceptionHandler(GlobalException e){
        e.printStackTrace();
        return AjaxResult.me().setSuccess(false).setMessage(e.getMessage());
    }


    @ExceptionHandler(value = Exception.class)
    public AjaxResult AllExceptionHandler(Exception e){
        e.printStackTrace();
        return AjaxResult.me().setSuccess(false).setMessage("正在殴打程序猿："+e.getMessage());
    }

}
